package com.ruoyi.project.system.sample.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.project.system.sample.domain.MySampleData;
import com.ruoyi.project.system.sample.mapper.MySampleDataMapper;
import com.ruoyi.project.system.sample.service.IMySampleDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.utils.text.Convert;

/**
 * 做样详情信息Service业务层处理
 * 
 * @author cc
 * @date 2024-08-15
 */
@Service
public class MySampleDataServiceImpl implements IMySampleDataService
{
    @Autowired
    private MySampleDataMapper mySampleDataMapper;

    /**
     * 查询做样详情信息
     * 
     * @param id 做样详情信息主键
     * @return 做样详情信息
     */
    @Override
    public MySampleData selectMySampleDataById(Long id)
    {
        return mySampleDataMapper.selectMySampleDataById(id);
    }

    /**
     * 查询做样详情信息列表
     * 
     * @param mySampleData 做样详情信息
     * @return 做样详情信息
     */
    @Override
    public List<MySampleData> selectMySampleDataList(MySampleData mySampleData)
    {
        return mySampleDataMapper.selectMySampleDataList(mySampleData);
    }

    /**
     * 新增做样详情信息
     * 
     * @param mySampleData 做样详情信息
     * @return 结果
     */
    @Override
    public int insertMySampleData(MySampleData mySampleData)
    {
        mySampleData.setCreateTime(DateUtils.getNowDate());
        return mySampleDataMapper.insertMySampleData(mySampleData);
    }

    /**
     * 修改做样详情信息
     * 
     * @param mySampleData 做样详情信息
     * @return 结果
     */
    @Override
    public int updateMySampleData(MySampleData mySampleData)
    {
        mySampleData.setUpdateTime(DateUtils.getNowDate());
        return mySampleDataMapper.updateMySampleData(mySampleData);
    }

    /**
     * 批量删除做样详情信息
     * 
     * @param ids 需要删除的做样详情信息主键
     * @return 结果
     */
    @Override
    public int deleteMySampleDataByIds(String ids)
    {
        return mySampleDataMapper.deleteMySampleDataByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除做样详情信息信息
     * 
     * @param id 做样详情信息主键
     * @return 结果
     */
    @Override
    public int deleteMySampleDataById(Long id)
    {
        return mySampleDataMapper.deleteMySampleDataById(id);
    }
}
